package org.diysearch.tests;

import java.util.List;

import junit.framework.TestCase;

import org.diysearch.helpers.SearchHelper;
import org.diysearch.models.Link;
import org.diysearch.models.SearchResult;

public class SearchTests extends TestCase {
	public void testSearch() {
		String query="TEST";
		
		try {
			SearchResult sr = SearchHelper.search(query);
			List<Link> links = sr.getLinks();
			Object[] facets = sr.getFacets();
			assertNotNull("results list", sr);
			
			for (Link link : links) {
				System.out.println(link);
			}
			System.out.println("===============");
			
			for (Object facet : facets) {
				System.out.println(facet);
			}
			
		} catch (Exception ex) {
			ex.printStackTrace(System.out);
			fail("search fail");
		}
	}
}
